<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$sqlReport = "SELECT distinct `district_id`,`district_name`,`block_id`,`block_name` FROM `tbl_lookup_location` where `district_id` = ".$distId." group by `block_id`";
$queryReport = mysql_query($sqlReport);
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Report</title>
</head>
<body>
<table border="0" width="900" cellspacing="0" cellpadding="0">
	<tr>
		<td bgcolor="#E9E9E9" height="26">
		<p align="center"><span style="font-size: 9pt; font-weight: 700">
		<font face="Verdana" color="#224568">Block wise average minimum and maximum water table fluctuation (as per PHED)</font></span></td>
	</tr>
	<tr><td bgcolor="#E9E9E9" height="26"><div align="center"><font face="Verdana" style="font-size: 9pt; font-weight: 700" color="#224568">Table 24 </font></div></td>
	</tr>
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="900" cellspacing="0" cellpadding="0" height="47" bgcolor="#C5D8EB">
			<tr>
				<td width="80" align="center" rowspan="2">
				<font style="font-size: 8.5pt" face="Verdana">District</font></td>
				<td width="80" align="center" rowspan="2">
				<font style="font-size: 8.5pt" face="Verdana">Block</font></td>
				<td width="80" align="center" rowspan="2">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
				Functional</font></td>
				<td width="80" align="center" colspan="2">
				<font style="font-size: 8.5pt" face="Verdana">Water table fluctuation (m)</font></td>
								
			</tr>
		
			<tr>
				
				<td align="center" width="40"><font style="font-size: 8.5pt" face="Verdana">Min</font></td>
				<td align="center" width="40"><font style="font-size: 8.5pt" face="Verdana">Max</font></td>
				
		</tr>
		<?php
			//$numVillage=0;
			//$numFormVill=0;
			while($rowReport = mysql_fetch_array($queryReport)) {
		?>
			<tr bgcolor="#FFFFFF">
				<td width="" align="center"><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport['district_name'];?></font></td>
				<td width="" align="center"><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport['block_name'];?></font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana"><?php echo getTotalNotfunctional($rowReport['block_id'],'FUNCTIONAL');?></font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana"><?php echo getRangeWater($rowReport['block_id'],'water_table_min');?></font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana"><?php echo getRangeWater($rowReport['block_id'],'water_table_max');?></font></td>
				
				
				
				
				
			</tr>
			<?php
			}
			?>
			<tr bgcolor="#E9E9E9">
				<td width="" align="center"><font style="font-size: 8.5pt" face="Verdana">Total</font></td>
				<td width="" align="center"><font style="font-size: 8.5pt" face="Verdana">&nbsp;</font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana"><?php echo getSumfunctionalStatus($distId,'FUNCTIONAL');?></font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana">&nbsp;</font></td>
				<td align="center" width=""><font style="font-size: 8.5pt" face="Verdana">&nbsp;</font></td>
				
				
			</tr>

			
		</table>
		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>



</body>

</html>

